<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  

  
  <title>HTML基础知识点-表单 | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="Form标签中，以下标签实现表单元素的添加    标签 描述    &amp;lt;input&amp;gt; 表单输入标签   &amp;lt;select&amp;gt; 菜单和列表标签   &amp;lt;option&amp;gt; 菜单和列表项目标签   &amp;lt;textarea&amp;gt; 文字域标签   &amp;lt;optgroup&amp;gt; 菜单和列表项目分组标签   &amp;lt;form&amp;gt;标签属性   属性 值 描述    acti">
<meta name="keywords" content="HTML">
<meta property="og:type" content="article">
<meta property="og:title" content="HTML基础知识点-表单">
<meta property="og:url" content="http://yoursite.com/2019/07/25/HTML基础知识点-表单/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="Form标签中，以下标签实现表单元素的添加    标签 描述    &amp;lt;input&amp;gt; 表单输入标签   &amp;lt;select&amp;gt; 菜单和列表标签   &amp;lt;option&amp;gt; 菜单和列表项目标签   &amp;lt;textarea&amp;gt; 文字域标签   &amp;lt;optgroup&amp;gt; 菜单和列表项目分组标签   &amp;lt;form&amp;gt;标签属性   属性 值 描述    acti">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2019-07-26T14:16:08.141Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="HTML基础知识点-表单">
<meta name="twitter:description" content="Form标签中，以下标签实现表单元素的添加    标签 描述    &amp;lt;input&amp;gt; 表单输入标签   &amp;lt;select&amp;gt; 菜单和列表标签   &amp;lt;option&amp;gt; 菜单和列表项目标签   &amp;lt;textarea&amp;gt; 文字域标签   &amp;lt;optgroup&amp;gt; 菜单和列表项目分组标签   &amp;lt;form&amp;gt;标签属性   属性 值 描述    acti">
  
    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-HTML基础知识点-表单" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/07/25/HTML基础知识点-表单/" class="article-date">
  <time datetime="2019-07-25T05:23:35.000Z" itemprop="datePublished">2019-07-25</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/HTML/">HTML</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      HTML基础知识点-表单
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <hr>
<p>Form标签中，以下标签实现表单元素的添加</p>
<table>
<thead>
<tr>
<th>标签</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td><code>&lt;input&gt;</code></td>
<td>表单输入标签</td>
</tr>
<tr>
<td><code>&lt;select&gt;</code></td>
<td>菜单和列表标签</td>
</tr>
<tr>
<td><code>&lt;option&gt;</code></td>
<td>菜单和列表项目标签</td>
</tr>
<tr>
<td><code>&lt;textarea&gt;</code></td>
<td>文字域标签</td>
</tr>
<tr>
<td><code>&lt;optgroup&gt;</code></td>
<td>菜单和列表项目分组标签</td>
</tr>
</tbody></table>
<h2 id="lt-form-gt-标签属性"><a href="#lt-form-gt-标签属性" class="headerlink" title="&lt;form&gt;标签属性"></a><code>&lt;form&gt;</code>标签属性</h2><table>
<thead>
<tr>
<th>属性</th>
<th>值</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>action</td>
<td>URL</td>
<td>提交表单时向何处发送表单数据</td>
</tr>
<tr>
<td>method</td>
<td>get，post</td>
<td>设置表单以何种方式发送到指定页面</td>
</tr>
<tr>
<td>name</td>
<td>form_name</td>
<td>表单的名称</td>
</tr>
<tr>
<td>target</td>
<td>_blank,_self,_parent,_top</td>
<td>在何处打开action URL</td>
</tr>
<tr>
<td>enctype</td>
<td>application/x-www-form-urlencoded, multiple/form-data, text/plain</td>
<td>在发送表单数据之前如何对其编码</td>
</tr>
</tbody></table>
<h2 id="input标签属性"><a href="#input标签属性" class="headerlink" title="input标签属性"></a>input标签属性</h2><table>
<thead>
<tr>
<th>Type属性值</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>text</td>
<td>文字域</td>
</tr>
<tr>
<td>password</td>
<td>密码域</td>
</tr>
<tr>
<td>file</td>
<td>文件域</td>
</tr>
<tr>
<td>checkbox</td>
<td>复选域</td>
</tr>
<tr>
<td>radio</td>
<td>单选域</td>
</tr>
<tr>
<td>Button</td>
<td>按钮</td>
</tr>
<tr>
<td>Submit</td>
<td>提交按钮</td>
</tr>
<tr>
<td>Reset</td>
<td>重置按钮</td>
</tr>
<tr>
<td>Hidden</td>
<td>隐藏域</td>
</tr>
<tr>
<td>image</td>
<td>图像域</td>
</tr>
</tbody></table>
<h3 id="单选框和复选框"><a href="#单选框和复选框" class="headerlink" title="单选框和复选框"></a>单选框和复选框</h3><p>注：name值必须一致</p>
<h3 id="image"><a href="#image" class="headerlink" title="image"></a>image</h3><p>图像域既有图像，也能实现提交功能</p>
<h2 id="下拉菜单和列表标签"><a href="#下拉菜单和列表标签" class="headerlink" title="下拉菜单和列表标签"></a>下拉菜单和列表标签</h2><h3 id="语法"><a href="#语法" class="headerlink" title="语法"></a>语法</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;select&gt;</span><br><span class="line">    &lt;option value=&quot;&quot;&gt;选项&lt;/option&gt;</span><br><span class="line">    &lt;option value=&quot;&quot;&gt;选项&lt;/option&gt;</span><br><span class="line">&lt;/select&gt;</span><br></pre></td></tr></table></figure>

<h3 id="select标签属性"><a href="#select标签属性" class="headerlink" title="select标签属性"></a>select标签属性</h3><table>
<thead>
<tr>
<th>属性</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>name</td>
<td>设置下拉菜单和列表的名称</td>
</tr>
<tr>
<td>multiple</td>
<td>设置可选择多个选项</td>
</tr>
<tr>
<td>size</td>
<td>设置列表中可见选项的数目</td>
</tr>
</tbody></table>
<h3 id="option标签属性"><a href="#option标签属性" class="headerlink" title="option标签属性"></a>option标签属性</h3><table>
<thead>
<tr>
<th>属性</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>selected</td>
<td>设置选项初始选中状态</td>
</tr>
<tr>
<td>value</td>
<td>定义送往服务器的选项值</td>
</tr>
</tbody></table>
<h2 id="分组下拉菜单和列表"><a href="#分组下拉菜单和列表" class="headerlink" title="分组下拉菜单和列表"></a>分组下拉菜单和列表</h2><h3 id="语法-1"><a href="#语法-1" class="headerlink" title="语法"></a>语法</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&lt;select&gt;</span><br><span class="line">    &lt;optgroup label=&quot;组1&quot;&gt;</span><br><span class="line">    &lt;option value=&quot;&quot;&gt;选项&lt;/option&gt;</span><br><span class="line">    &lt;option value=&quot;&quot;&gt;选项&lt;/option&gt;</span><br><span class="line">    ...</span><br><span class="line">    &lt;optgroup label=&quot;组2&quot;&gt;</span><br><span class="line">    &lt;option value=&quot;&quot;&gt;选项&lt;/option&gt;</span><br><span class="line">    &lt;option value=&quot;&quot;&gt;选项&lt;/option&gt;</span><br><span class="line">    ...</span><br><span class="line">&lt;/select&gt;</span><br></pre></td></tr></table></figure>

<h2 id="多行文本域-lt-textarea-gt"><a href="#多行文本域-lt-textarea-gt" class="headerlink" title="多行文本域&lt;textarea&gt;"></a>多行文本域<code>&lt;textarea&gt;</code></h2><h3 id="语法-2"><a href="#语法-2" class="headerlink" title="语法"></a>语法</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;textarea name=&quot;&quot; rows=&quot;&quot; cols=&quot;&quot;&gt;</span><br><span class="line">    内容...</span><br><span class="line">&lt;/textarea&gt;</span><br></pre></td></tr></table></figure>

<table>
<thead>
<tr>
<th>属性</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>name</td>
<td>设置文本区的名称</td>
</tr>
<tr>
<td>placeholder</td>
<td>设置描述文本区域预期值的简短提示</td>
</tr>
<tr>
<td>rows</td>
<td>设置文本区内的可见行数</td>
</tr>
<tr>
<td>cols</td>
<td>设置文本区内的可见宽度</td>
</tr>
</tbody></table>
<h2 id="post和get的区别"><a href="#post和get的区别" class="headerlink" title="post和get的区别"></a>post和get的区别</h2><p>GET：</p>
<ul>
<li><p>使用URL传递参数</p>
</li>
<li><p>对所发送信息的数量也有限制</p>
</li>
<li><p>一般用于信息获取</p>
</li>
<li><p>保密性差</p>
</li>
</ul>
<p>POST：</p>
<ul>
<li><p>表单数据作为HTTP请求体的一部分</p>
</li>
<li><p>对所发送信息的数量无限制</p>
</li>
<li><p>一般用于修改服务器上的资源</p>
</li>
<li><p>保密性好</p>
</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/07/25/HTML基础知识点-表单/" data-id="ck4r400po0044l0w0czogbyin" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/HTML/">HTML</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/07/29/HTML基础知识点-div和span与块级和行内标签/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          HTML基础知识点--div和span与块级和行内标签
        
      </div>
    </a>
  
  
    <a href="/2019/07/24/HTML基础知识点-表格/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">HTML基础知识点-表格</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Ajax/">Ajax</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS/">CSS</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS3/">CSS3</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Dart/">Dart</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Flutter/">Flutter</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Git/">Git</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/HTML/">HTML</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/HTML5/">HTML5</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/JSON/">JSON</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Java/">Java</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/JavaScript/">JavaScript</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/QT/">QT</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/React/">React</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Sass/">Sass</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/TheKnowledgeOf/">TheKnowledgeOf</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/TypeScript/">TypeScript</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/bootstrap/">bootstrap</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/jQuery/">jQuery</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Ajax/">Ajax</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CSS/">CSS</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CSS3/">CSS3</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Dart/">Dart</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Flutter/">Flutter</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Git/">Git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/HTML/">HTML</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/HTML5/">HTML5</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JSON/">JSON</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Java/">Java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Javascript/">Javascript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/QT/">QT</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/React/">React</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Sass/">Sass</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/TheKnowledgeOf/">TheKnowledgeOf</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/TypeScript/">TypeScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/bootstrap/">bootstrap</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jQuery/">jQuery</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Ajax/" style="font-size: 12.22px;">Ajax</a> <a href="/tags/CSS/" style="font-size: 18.89px;">CSS</a> <a href="/tags/CSS3/" style="font-size: 17.78px;">CSS3</a> <a href="/tags/Dart/" style="font-size: 14.44px;">Dart</a> <a href="/tags/Flutter/" style="font-size: 16.67px;">Flutter</a> <a href="/tags/Git/" style="font-size: 12.22px;">Git</a> <a href="/tags/HTML/" style="font-size: 14.44px;">HTML</a> <a href="/tags/HTML5/" style="font-size: 12.22px;">HTML5</a> <a href="/tags/JSON/" style="font-size: 10px;">JSON</a> <a href="/tags/Java/" style="font-size: 11.11px;">Java</a> <a href="/tags/JavaScript/" style="font-size: 20px;">JavaScript</a> <a href="/tags/Javascript/" style="font-size: 10px;">Javascript</a> <a href="/tags/QT/" style="font-size: 12.22px;">QT</a> <a href="/tags/React/" style="font-size: 15.56px;">React</a> <a href="/tags/Sass/" style="font-size: 11.11px;">Sass</a> <a href="/tags/TheKnowledgeOf/" style="font-size: 11.11px;">TheKnowledgeOf</a> <a href="/tags/TypeScript/" style="font-size: 10px;">TypeScript</a> <a href="/tags/bootstrap/" style="font-size: 11.11px;">bootstrap</a> <a href="/tags/jQuery/" style="font-size: 13.33px;">jQuery</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/12/">December 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/11/">November 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/10/">October 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/09/">September 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">August 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/07/">July 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">June 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/05/">May 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">April 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2019/12/29/Flutter-MaterialApp常用属性介绍/">Flutter-MaterialApp常用属性介绍</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-ListView/">Flutter-ListView</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-AppBar/">Flutter-AppBar</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-TabBar/">Flutter-TabBar</a>
          </li>
        
          <li>
            <a href="/2019/12/29/Flutter-按钮/">Flutter-按钮</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2019 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>